package com.atguigu.controller;

import com.atguigu.pojo.School;
import com.atguigu.service.SchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@ResponseBody
public class SchoolController {
    @Autowired
    private SchoolService schoolService;

    @RequestMapping("/select")
    List<School> selectAllCon(){
        List<School> schools = schoolService.selectAllService();
        schools.forEach(System.out::println);
        return schools;
    }

}
